﻿using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.Linq;
using System.Web;
using System.Web.Mvc;

using Bricks.Component.Utils;
using Bricks.Business.Models.Account;
using Bricks.Site.Models;

using Webdiyer.WebControls.Mvc;
using Bricks.Business.Service;


namespace Bricks.Site.Web.Controllers
{
    [Export]
    public class HomeController : Controller
    {
        [Import]
        public IUserInfoService UserService { get; set; }

        public ActionResult Index(int? id)
        {
            //int pageIndex = id ?? 1;
            //const int pageSize = 20;
            //PropertySortCondition[] sortConditions = new[] { new PropertySortCondition("ID") };
            //int total;
            //var userViews = UserService.Users.Where<UserInfo, Guid>(m => true, pageIndex, pageSize, out total, sortConditions).Select(m => new UserView
            //{
            //    UserName = m.UserName,
            //    NickName = m.RealName,
            //    Email = m.Email,
            //    IsDeleted = m.IsDeleted,
            //    AddDate = m.AddDate,
            //    //LoginLogCount = m.LoginLogs.Count,
            //    //RoleNames = m.Roles.Select(n => n.Name)
            //});
            //PagedList<UserView> model = new PagedList<UserView>(userViews, pageIndex, pageSize, total);
            //return View(model);
            return View();
        }
    }
}
